﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IRIS.Models;

namespace IRIS.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            var rep = new DataRepo();
            var News = rep.getNews().Take(3);
            //Count how many pages there are
            var pages = rep.getNews().Count()/5.0;
            pages = Math.Ceiling(pages);
            int intPages = Convert.ToInt32(pages);

            var model = new NewsViewModel {m_News = News, m_Pages = intPages};

            return View(model);
        }
    }
}
